Skip to main content

Vecto TypeScript SDK Client Documentation

Here is the documentation for our TypeScript Client.

Installation

npm install @xpressai/vecto-client

For the token, sign up for your access here.

Quickstart

import { Configuration, IndexApi, IndexDataRequest, LookupApi, LookupRequest } from '@xpressai/vecto-client';


const config = new Configuration({
accessToken: 'your-vecto-token'
});

// Ingest

const indexApi = new IndexApi(config);
const textBlob = new Blob(["Hello Vecto"]);


const textDataParams: IndexDataRequest = {
vectorSpaceId: your-vector-space-id,
modality: 'TEXT',
attributes: [JSON.stringify("sample metadata")],
input: [textBlob];
};

await indexApi.indexData(textDataParams);

// Lookup

const lookupApi = new LookupApi(config);

const textParams: LookupRequest = {
vectorSpaceId: your-vector-space-id,
modality: 'TEXT',
topK: 3,
query: 'text query',
};

const results = await lookupApi.lookup(textParams);

Developers Discord

Have any questions or need support? Feel free to chat with the devs at our Discord!

Support

For issues with the SDK, please raise a GitHub issue. For issues related to the API or other inquiries, please contact Vecto support.